package com.baimifan.renovation.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.baimifan.renovation.model.TwoClassifyData;
import com.baimifan.renovation.publicfrag.TaskFragment;

import java.util.ArrayList;

/**
 * Created by sunyuanfei on 2017/7/7.
 */

public class TaskFragAdapter extends FragmentPagerAdapter {
    private ArrayList<TwoClassifyData> mlist;
    public TaskFragAdapter(FragmentManager fm, ArrayList<TwoClassifyData> list) {
        super(fm);
        this.mlist = list;
    }

    @Override
    public Fragment getItem(int position) {
        return TaskFragment.newInstance(mlist.get(position).getSecId() + "");
    }

    @Override
    public int getCount() {
        return mlist.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mlist.get(position).getCatName();
    }
}
